/**
 * @description：描述
 * @author: zhangYuanTao
 * @date: 2021-07-14 23:00
 * @LastEditTime : 2021-07-14 23:00
 * @FilePath : actionCreators
 */
import * as actionTypes from "./constants";
import { getTopBanners } from "@/services/recommend";

const changeTopBannerAction = (res) => ({
  type: actionTypes.CHANGE_TOP_BANNERS,
  topBanners: res['banners']
})
export const getTopBannerAction = () => {
  return dispatch => {
    getTopBanners().then(res => {
      console.log('%c 🎂 res: ', 'font-size:20px;background-color: #6EC1C2;color:#fff;', res);
      dispatch(changeTopBannerAction(res));
    })
  }
}
